home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / pctchnqs / 1991 / number3 / shades / adunit.pas next >
Pascal/Delphi Source File  |  1991-06-13  |  3KB  |  100 lines

  1. { adunit.pas -- After Dark TPW support unit by Tom Swan }
  2.  
  3. unit ADUnit;
  4.  
  5. interface
  6.  
  7. uses WinTypes;
  8.  
  9. const
  10.  
  11. {- Control messages }
  12.   initialize     = 0;
  13.   blank          = 1;
  14.   drawFrame      = 2;
  15.   adClose        = 3;
  16.   moduleSelected = 5;
  17.   about          = 6;
  18.   buttonMessage  = 7;
  19.   preInitialize  = 12;
  20.  
  21. {- Error return codes }
  22.   noError        = 0;
  23.   mem_Error      = 1;
  24.   restart_me     = 3;
  25.   wake_up        = 5;
  26.   user_error     = 7;
  27.  
  28. {- Palette request return codes }
  29.   hsv_Pal        = 10;
  30.   rgb_Pal        = 11;
  31.   white_Pal      = 12;
  32.   primary_Pal    = 13;
  33.  
  34. {- Screen saver mode }
  35.   saver          = 0;
  36.   demo           = 1;
  37.  
  38. {- Processor type }
  39.   cpu_086        = 0;
  40.   cpu_186        = 1;
  41.   cpu_286        = 2;
  42.   cpu_386        = 3;
  43.   cpu_486        = 4;
  44.  
  45. {- Operating mode }
  46.   realMode       = 0;
  47.   standard       = 1;
  48.   enhanced       = 2;
  49.  
  50. {- Module being run by: }
  51.   afterDark      = 0;
  52.   randomizer     = 1;
  53.  
  54. type
  55.   Pad_System = ^Tad_System;   { Pointer to following record }
  56.   Tad_System = record
  57.     iOperatingMode: Integer;  { Real, standard, enhanced mode }
  58.     iProcessorType: Integer;  { 8086, 80186, 80286, 80386, 80486}
  59.     bCoProcessor: Bool;       { True if coprocessor present }
  60.     ptScreenSize: TPoint;     { Screen resolution in pixels }
  61.     iBitsPerPixel: Integer;   { Color resolution (pixel depth) }
  62.     ptAspect: TPoint;         { Monitor aspect ratio (X / Y) }
  63.     ptDotsPerInch: TPoint;    { Number of pixels per inch }
  64.     iADVersion: Integer;      { After Dark version number }
  65.     rDemoRect: TRect;         { Control panel rect in demo mode }
  66.     iSaverMode: Integer;      { AD mode: "saver" or "demo" }
  67.     hModuleInfo: THandle;     { Module-specified record handle }
  68.     lpszErrorMessage: PChar;  { Pointer to custom error string }
  69.     hADWnd: HWnd;             { Control panel window handle }
  70.     iRunner: Integer;         { Controller: AD or Randomizer }
  71.   end;
  72.  
  73.   Pad_Module = ^Tad_Module;   { Pointer to following record }
  74.   Tad_Module = record
  75.     hDrawRgn: HRGN;           { Region in which to draw }
  76.     ptRgnSize: TPoint;        { Region drawing size }
  77.     iControlValue: array[0 .. 3] of Integer; { Control settings }
  78.     iControlID:    array[0 .. 3] of Integer; { Control IDs }
  79.     hModule: THandle;         { DLL module's handle }
  80.     hPalette: HPalette;       { Handle to palette (if used) }
  81.     lpLogPalette: PLogPalette;{ Pointer to palette (if used) }
  82.   end;
  83.  
  84. var
  85.   HLibInst: THandle;    { Handle to DLL instance }
  86.   DC: HDC;              { Display context }
  87.   HSystem: THandle;     { Handle to system parameters }
  88.   LpSystem: Pad_System; { Pointer to system parameters }
  89.   LpModule: Pad_Module; { Pointer to module parameters }
  90.  
  91. implementation
  92.  
  93. end.
  94.  
  95.  
  96. {--------------------------------------------------------------
  97.   Copyright (c) 1991 by Tom Swan. All rights reserved.
  98.   Revision 1.00    Date: 6/12/1991
  99. ---------------------------------------------------------------}
  100.